//Name: Object manager
//Author:Max Charnock
//Last Updated: 18/05/2014
//Purpose:singleton class which manages the world object for the game scene.

#pragma once

#include "AbstractEnemy.h"
#include "QuestGiver.h"
#include "Player.h"
#include "InstancedOrbs.h"
#include "Terrain.h"
#include "GameHUD.h"
#include "House.h"

#define OBJECT_MANAGER_INITIAL_NUM_ORBS 25

class ObjectManager
{
private:

	//pointer to object manager instance
	static ObjectManager* pInst;

	//contructors in private due to it being singleton
	ObjectManager();
	~ObjectManager();

	//player 
	Player* playerModel;

	//npc quest giver 
	QuestGiver* NPCModel;

	//vector of enemies
	std::vector<AbstractEnemy*> EnemyList;

	//vector of collectables
	InstancedOrbs* OrbInstance;
	// Represents the number of bog standard orbs that have been collected, use this so we
	// can output to the HUD.
	int numOrbsCollected;

	// A medal is awarded upon: 
	// 1. Collection of all 15 bog standard collectable orbs
	// 2-4. Completion of each quest should award the player with a medal
	int numMedalsCollected;

	//the complete game HUD
	GameHUD* HUD;

	House* house;

	Terrain* pTerrain;

public:

	//return pointer to object manager instance
	static ObjectManager* GetInstance();

	//Intialises all objects
	void Intialise(Terrain* terrain,VirtualCamera* camera,GraphicsInterface* graphics);

	//calls update function for all objects
	void Update(float delta);

	//checks all collisions
	void CheckCollisions();

	//adds all objects to batch
	void AddAllToBatch(GraphicsInterface* graphics);

	//deletes object manager instance
	void Release();

	void Respawn();

	//deleteds pointers for all objects
	void ReleaseObjects();

	//adds the HUD to render if active
	void HUDRender(GraphicsInterface* gi);
};